let fs = require("fs");
// 配置文件内容
let config_content = fs.readFileSync("./app.ini", { encoding: "utf-8" });
// 所有行
let all_line = config_content.split(/\r\n|\n/);
// 非空行
let not_empty_line = all_line.filter((t) => t.trim());
// 非注释行
let value_line = not_empty_line.filter((t) => t[0] != "#");
// 所有配置项
let config = {};
value_line
  .map((t) => t.split("="))
  .forEach((t) => {
    config[t[0]] = t[1];
  });
// 输出配置
module.exports = {
  content: not_empty_line.join("\n"),
  connection_port: config["connection_port"] || "",
  connection_user: config["connection_user"] || "",
  connection_password: config["connection_password"] || "",
  scconnection_hosthema: config["connection_host"] || "",
  schema: config["schema"] || "",
  package: config["package"] || "",
  file_path: config["file_path"] || "",
};
